package com.beans;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: Administrator
 * \* Date: 2022/7/17
 * \* Time: 14:02
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */

@Component
public class UserBean {
    @Bean({"user1"})
    public User getUser1(){
        User user = new User();
        user.setId(1);
        user.setName("瑞文");
        return user;
    }

    @Bean({"user2"})
    public User getUser2(){
        User user1 = new User();
        user1.setId(2);
        user1.setName("流浪法师");
        return user1;
    }
}
